import axios from 'axios';

export interface SongMeta {
    title: string
    artist: string
    lyricist: string
    composer: string
    album: string
    genre: string
    lyrics: string
    release_date: string
    file_path: string
};

export const GENRE_OPTIONS = new Array(
    "流行音乐 (Pop)",
    "摇滚 (Rock)",
    "嘻哈/说唱 (Hip-Hop/Rap)",
    "电子音乐 (Electronic)",
    "古典音乐 (Classical)",
    "爵士 (Jazz)",
    "乡村音乐 (Country)",
    "节奏布鲁斯 (R&B)",
    "雷鬼 (Reggae)",
    "金属 (Metal)",
    "舞曲 (Dance)",
    "民谣 (Folk)",
    "蓝调 (Blues)",
    "世界音乐 (World Music)",
    "电影原声 (Soundtrack)",
    "独立音乐 (Indie)",
    "福音音乐 (Gospel)",
    "实验音乐 (Experimental)",
    "儿童音乐 (Children's Music)",
    "拉丁音乐 (Latin)"
  ).map((k, _)=> ({ label: k, value: k }));

  export const downloadFile = async (url: string) => {
    try {
        // 发送 GET 请求，获取文件数据
        const response = await axios.get(url, {
          responseType: 'blob', // 将响应数据作为 Blob 对象返回
        });
        
        console.log(response.data);
      } catch (error) {
        console.error('文件下载失败', error);
      }
  }